<template>
  <div id="recruitTable">
    <el-dialog title="调出" :visible.sync="editFormVisible2" width="98%" top="20px">
      <el-form :model="editForm2" label-width="200px" ref="editForm2" :inline="true" style="padding:10px 0 0;clear:both" :rules="editFormRules2">
        <table cellspacing="0" cellpadding="0" class="mytable">
          <tr>
            <th style="width:130px; vertical-align: middle;">单位名称</th>
            <td style="vertical-align: middle;">
              {{editForm2.unitName}}
            </td>
            <th style="width:130px; vertical-align: middle;">部门</th>
            <td style="vertical-align: middle;">
              {{editForm2.deparentment}}
            </td>
            <th style="width:130px; vertical-align: middle;">姓名</th>
            <td style="vertical-align: middle;">
              {{editForm2.realName}}
            </td>
          </tr>
          <tr>
            <th style="width:130px; vertical-align: middle;">是否调出</th>
            <td style="vertical-align: middle;">
              <el-form-item prop="isOut" v-if="editFlag">
                <el-select v-model="editForm2.isOut">
                  <el-option :value="0" label="否" />
                  <el-option :value="1" label="是" />
                </el-select>
              </el-form-item>
              <span v-else>{{editForm.gender?'是':'否'}}</span>
            </td>
            <th style="width:130px; vertical-align: middle;">调出时间</th>
            <td style="vertical-align: middle;">
              <el-form-item prop="outDate" v-if="editFlag">
                <el-date-picker
                  v-model="editForm2.outDate"
                  type="date"
                  value-format="yyyy-MM-dd">
                </el-date-picker>
              </el-form-item>
              <span v-else>{{editForm2.outDate}}</span>
            </td>
            <th style="width:130px; vertical-align: middle;">去向</th>
            <td style="vertical-align: middle;">
              <el-form-item prop="transferDirection" v-if="editFlag">
                <el-input v-model="editForm2.transferDirection" style="width:400px"></el-input>
              </el-form-item>
              <span v-else>{{editForm2.transferDirection}}</span>
            </td>
          </tr>
          <tr>
            <th style="width:130px; vertical-align: middle;">备注</th>
            <td style="vertical-align: middle;" colspan="5">
              <el-form-item prop="remarks" v-if="editFlag">
                <el-input v-model="editForm2.remarks" style="width:400px"></el-input>
              </el-form-item>
              <span v-else>{{editForm2.remarks}}</span>
            </td>
          </tr>
        </table>
        <el-button type="primary" @click.native="editFormSubmit2" :loading="saveloading" v-if="editFlag">提交</el-button>
      </el-form>
    </el-dialog>
    <el-dialog :title="dialogTitle" :visible.sync="editFormVisible" width="98%" top="20px">
      <el-form :model="editForm" label-width="200px" ref="editForm" :inline="true" style="padding:10px 0 0;clear:both" :rules="editFormRules">
        <table cellspacing="0" cellpadding="0" class="mytable">
          <tr>
            <th style="width:130px; vertical-align: middle;">单位名称</th>
            <td style="vertical-align: middle;">
              <el-form-item prop="unitName" v-if="editFlag">
                <el-input v-model="editForm.unitName" style="width:400px"></el-input>
              </el-form-item>
              <span v-else>{{editForm.unitName}}</span>
            </td>
            <th style="width:130px; vertical-align: middle;">岗位类型</th>
            <td style="vertical-align: middle;">
              <el-form-item prop="postClass" v-if="editFlag">
                <el-select v-model="editForm.postClass" @change="changePostClass()">
                  <el-option v-for="(item,index) in postClassList" :key="'education'+index" :value="index+1" :label="item" />
                </el-select>
              </el-form-item>
              <span v-else>{{postClassList[editForm.postClass-1]}}</span>
            </td>
            <th style="width:130px; vertical-align: middle;">岗位等级</th>
            <td style="vertical-align: middle;">
              <el-form-item prop="postLevel" v-if="editFlag">
                <el-select v-model="editForm.postLevel">
                  <el-option v-for="(item,index) in postLevelList" :key="'postLevel'+index" :value="item.id" :label="item.label" />
                </el-select>
              </el-form-item>
              <span v-else>
                <span v-if="editForm.postClass===1">{{managePostLevel.find(item=>item.id===editForm.postLevel).label}}</span>
                <span v-else-if="editForm.postClass===2">{{techPostLevel.find(item=>item.id===editForm.postLevel).label}}</span>
                <span v-else-if="editForm.postClass===3">{{workPostLevel.find(item=>item.id===editForm.postLevel).label}}</span>
              </span>
            </td>
          </tr>
            <tr>
              <th style="width:130px; vertical-align: middle;">部门</th>
              <td style="vertical-align: middle;">
                <el-form-item prop="deparentment" v-if="editFlag">
                  <el-input v-model="editForm.deparentment" style="width:200px"></el-input>
                </el-form-item>
                <span v-else>{{editForm.deparentment}}</span>
              </td>
              <th style="width:130px; vertical-align: middle;">姓名</th>
              <td style="vertical-align: middle;">
                <el-form-item prop="realName" v-if="editFlag">
                  <el-input v-model="editForm.realName" style="width:200px"></el-input>
                </el-form-item>
                <span v-else>{{editForm.realName}}</span>
              </td>
              <th style="width:120px; vertical-align: middle;">性别</th>
              <td style="vertical-align: middle;">
                <el-form-item prop="gender" v-if="editFlag">
                  <el-select v-model="editForm.gender">
                    <el-option :value="1" label="男" />
                    <el-option :value="2" label="女" />
                  </el-select>
                </el-form-item>
                <span v-else>{{editForm.gender===1?'男':'女'}}</span>
              </td>
            </tr>
            <tr>
              <th style="width:130px; vertical-align: middle;">最高学位</th>
              <td style="vertical-align: middle;">
                <el-form-item prop="degree" v-if="editFlag">
                  <el-select v-model="editForm.degree">
                    <el-option v-for="(item,index) in degreeList" :key="'education'+index" :value="item" :label="item" />
                  </el-select>
                </el-form-item>
                <el-form-item prop="degreeClass" v-if="editFlag">
                  <el-input v-model="editForm.degreeClass" style="width:200px" placeholder="请填写门类"></el-input>
                </el-form-item>
                <span v-else>{{editForm.degreeClass}}{{editForm.degree}}</span>
              </td>
              <th style="width:130px; vertical-align: middle;">最高学历</th>
              <td style="vertical-align: middle;">
                <el-form-item prop="education" v-if="editFlag">
                  <el-select v-model="editForm.education">
                    <el-option v-for="(item,index) in educationList" :key="'education'+index" :value="item" :label="item" />
                  </el-select>
                </el-form-item>
                <span v-else>{{editForm.education}}</span>
              </td>
              <th style="width:130px; vertical-align: middle;">出生日期</th>
              <td style="vertical-align: middle;">
                <el-form-item prop="birthday" v-if="editFlag">
                  <el-date-picker
                    v-model="editForm.birthday"
                    value-format="yyyy-MM-dd"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
                </el-form-item>
                <span v-else>{{editForm.birthday}}</span>
              </td>
            </tr>
            <tr>
              <th style="width:130px; vertical-align: middle;">现任职务</th>
              <td style="vertical-align: middle;">
                <el-form-item prop="job" v-if="editFlag">
                  <el-input v-model="editForm.job" style="width:200px"></el-input>
                </el-form-item>
                <span v-else>{{editForm.job}}</span>
              </td>
              <th style="width:130px; vertical-align: middle;">职称</th>
              <td style="vertical-align: middle;">
                <el-form-item prop="jobTitle" v-if="editFlag">
                  <el-select v-model="editForm.jobTitle">
                    <el-option v-for="(item,index) in jobTitleList" :key="'education'+index" :value="item" :label="item" />
                  </el-select>
                </el-form-item>
                <span v-else>{{editForm.jobTitle}}</span>
              </td>
              <th style="width:130px; vertical-align: middle;">身份证号</th>
              <td style="vertical-align: middle;">
                <el-form-item prop="idCardNo" v-if="editFlag">
                  <el-input v-model="editForm.idCardNo" style="width:200px"></el-input>
                </el-form-item>
                <span v-else>{{editForm.idCardNo}}</span>
              </td>
            </tr>
            <template v-if="editForm.postLevel<=4&&editForm.postClass===2">
              <tr>
                <th style="width:130px; vertical-align: middle;">毕业院校及专业<br>（从本科阶段填起）</th>
                <td style="vertical-align: middle;" colspan="5">
                  <el-form-item prop="school" v-if="editFlag">
                    <el-input type="textarea" :rows="3" v-model="editForm.school" style="width:800px" maxlength="200" show-word-limit></el-input>
                  </el-form-item>
                  <span v-else>{{editForm.school}}</span>
                </td>
              </tr>
              <tr>
                <th style="width:130px; vertical-align: middle;">研究方向</th>
                <td style="vertical-align: middle;" colspan="5">
                  <el-form-item prop="researchDirection" v-if="editFlag">
                    <el-input type="textarea" :rows="3" v-model="editForm.researchDirection" style="width:800px" maxlength="200" show-word-limit></el-input>
                  </el-form-item>
                  <span v-else>{{editForm.researchDirection}}</span>
                </td>
              </tr>
              <tr>
                <th style="width:130px; vertical-align: middle;">入选人才工程情况</th>
                <td style="vertical-align: middle;" colspan="5">
                  <el-form-item prop="talentProjects" v-if="editFlag">
                    <el-input type="textarea" :rows="3" v-model="editForm.talentProjects" style="width:800px" maxlength="200" show-word-limit></el-input>
                  </el-form-item>
                  <span v-else>{{editForm.talentProjects}}</span>
                </td>
              </tr>
              <tr>
                <th style="width:130px; vertical-align: middle;">本聘期起止时间</th>
                <td style="vertical-align: middle;">
                  <el-form-item prop="docDate" v-if="editFlag">
                    <el-date-picker
                      v-model="editForm.docDate"
                      type="daterange"
                      range-separator="至"
                      start-placeholder="开始日期"
                      end-placeholder="结束日期"
                      value-format="yyyy-MM-dd"
                    >
                    </el-date-picker>
                  </el-form-item>
                  <span v-else>{{editForm.docDate[0]}}至{{editForm.docDate[1]}}</span>
                </td>
                <th style="width:130px; vertical-align: middle;">是否占用专业技术二级岗位</th>
                <td style="vertical-align: middle;" colspan="3">
                  <el-form-item prop="useTechPost2" v-if="editFlag">
                    <el-select v-model="editForm.useTechPost2">
                      <el-option :value="1" label="是" />
                      <el-option :value="0" label="否" />
                    </el-select>
                  </el-form-item>
                  <span v-else>{{editForm.useTechPost2?'是':'否'}}</span>
                </td>
              </tr>
              <tr>
                <th style="width:130px; vertical-align: middle;">占用指标类型</th>
                <td style="vertical-align: middle;">
                  <el-form-item prop="postType" v-if="editFlag">
                    <el-select v-model="editForm.postType" @change="changePostType()">
                      <el-option v-for="(item,index) in postTypeList" :key="'education'+index" :value="index+1" :label="item" />
                    </el-select>
                  </el-form-item>
                  <span v-else>{{postTypeList[editForm.postType-1]}}</span>
                </td>
                <th style="width:120px; vertical-align: middle;">依据文号</th>
                <td style="vertical-align: middle;" colspan="3">
                  <el-form-item prop="postId" v-if="editFlag">
                    <el-select v-model="editForm.postId" v-loading="selectLoading" :disabled="selectLoading">
                      <el-option v-for="(item,index) in docList" :key="'education'+index" :value="item.id" :label="item.docNum" />
                    </el-select>
                  </el-form-item>
                  <span v-else>{{editForm.docNum}}</span>
                </td>
              </tr>
            </template>
        </table>
        <el-button type="primary" @click.native="editFormSubmit" :loading="saveloading" v-if="editFlag">提交</el-button>
      </el-form>
    </el-dialog>
    <el-dialog title="详情" :visible.sync="editFormVisible3" width="98%" top="20px">
      <table cellspacing="0" cellpadding="0" class="mytable">
        <tr>
          <th style="width:130px; vertical-align: middle;">操作用户</th>
          <td style="vertical-align: middle;">
            {{editForm3.operateUser}}
          </td>
          <th style="width:130px; vertical-align: middle;">操作时间</th>
          <td style="vertical-align: middle;">
            {{editForm3.operateTime}}
          </td>
          <th style="width:130px; vertical-align: middle;">操作类型</th>
          <td style="vertical-align: middle;">
            <span v-if="editForm3.operateType===1">新增</span>
            <span v-else-if="editForm3.operateType===2">修改</span>
            <span v-else-if="editForm3.operateType===3">删除</span>
          </td>
        </tr>
        <tr>
          <th style="width:130px; vertical-align: middle;text-align:center;width:20%"></th>
          <th style="width:130px; vertical-align: middle;text-align:center;width:40%" colspan="3">操作前</th>
          <th style="width:130px; vertical-align: middle;text-align:center;width:40%" colspan="2">操作后</th>
        </tr>
        <tr>
          <th>单位</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).unitName">{{JSON.parse(editForm3.beforeContent).unitName}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).unitName">{{JSON.parse(editForm3.afterContent).unitName}}</div></td>
        </tr>
        <tr>
          <th>岗位类型</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).postClass">{{fpostClass(JSON.parse(editForm3.beforeContent).postClass)}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).postClass">{{fpostClass(JSON.parse(editForm3.afterContent).postClass)}}</div></td>
        </tr>
        <tr>
          <th>岗位等级</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).postLevel">{{fpostLevel(JSON.parse(editForm3.beforeContent).postLevel)}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).postLevel">{{fpostLevel(JSON.parse(editForm3.afterContent).postLevel)}}</div></td>
        </tr>
        <tr>
          <th>部门</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).deparentment">{{JSON.parse(editForm3.beforeContent).deparentment}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).deparentment">{{JSON.parse(editForm3.afterContent).deparentment}}</div></td>
        </tr>
        <tr>
          <th>姓名</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).realName">{{JSON.parse(editForm3.beforeContent).realName}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).realName">{{JSON.parse(editForm3.afterContent).realName}}</div></td>
        </tr>
        <tr>
          <th>性别</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).gender">{{JSON.parse(editForm3.beforeContent).gender===1?'男':'女'}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).gender">{{JSON.parse(editForm3.afterContent).gender===1?'男':'女'}}</div></td>
        </tr>
        <tr>
          <th>最高学位</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).degree">{{JSON.parse(editForm3.beforeContent).degree}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).degree">{{JSON.parse(editForm3.afterContent).degree}}</div></td>
        </tr>
        <tr>
          <th>最高学位门类</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).degreeClass">{{JSON.parse(editForm3.beforeContent).degreeClass}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).degreeClass">{{JSON.parse(editForm3.afterContent).degreeClass}}</div></td>
        </tr>
        <tr>
          <th>最高学历</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).education">{{JSON.parse(editForm3.beforeContent).education}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).education">{{JSON.parse(editForm3.afterContent).education}}</div></td>
        </tr>
        <tr>
          <th>出生日期</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).birthday">{{JSON.parse(editForm3.beforeContent).birthday}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).birthday">{{JSON.parse(editForm3.afterContent).birthday}}</div></td>
        </tr>
        <tr>
          <th>现任职务</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).job">{{JSON.parse(editForm3.beforeContent).job}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).job">{{JSON.parse(editForm3.afterContent).job}}</div></td>
        </tr>
        <tr>
          <th>职称</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).jobTitle">{{JSON.parse(editForm3.beforeContent).jobTitle}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).jobTitle">{{JSON.parse(editForm3.afterContent).jobTitle}}</div></td>
        </tr>
        <tr>
          <th>身份证号</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).idCardNo">{{JSON.parse(editForm3.beforeContent).idCardNo}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).idCardNo">{{JSON.parse(editForm3.afterContent).idCardNo}}</div></td>
        </tr>
        <tr>
          <th>毕业院校及专业</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).school">{{JSON.parse(editForm3.beforeContent).school}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).school">{{JSON.parse(editForm3.afterContent).school}}</div></td>
        </tr>
        <tr>
          <th>研究方向</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).researchDirection">{{JSON.parse(editForm3.beforeContent).researchDirection}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).researchDirection">{{JSON.parse(editForm3.afterContent).researchDirection}}</div></td>
        </tr>
        <tr>
          <th>入选人才工程情况</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).talentProjects">{{JSON.parse(editForm3.beforeContent).talentProjects}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).talentProjects">{{JSON.parse(editForm3.afterContent).talentProjects}}</div></td>
        </tr>
        <tr>
          <th>本聘期起止时间</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).startDate">{{JSON.parse(editForm3.beforeContent).startDate}}至{{JSON.parse(editForm3.beforeContent).endDate}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).startDate">{{JSON.parse(editForm3.afterContent).startDate}}至{{JSON.parse(editForm3.afterContent).endDate}}</div></td>
        </tr>
        <tr>
          <th>是否占用专业技术二级岗位</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).useTechPost2">{{JSON.parse(editForm3.beforeContent).useTechPost2?'是':'否'}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).useTechPost2">{{JSON.parse(editForm3.afterContent).useTechPost2?'是':'否'}}</div></td>
        </tr>
        <tr>
          <th>占用指标类型</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).postType">{{JSON.parse(editForm3.beforeContent).postType}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).postType">{{JSON.parse(editForm3.afterContent).postType}}</div></td>
        </tr>
        <tr>
          <th>依据文号</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).postId">{{JSON.parse(editForm3.beforeContent).postId}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).postId">{{JSON.parse(editForm3.afterContent).postId}}</div></td>
        </tr>
        <tr>
          <th>是否调出</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).isOut">{{JSON.parse(editForm3.beforeContent).isOut?'是':'否'}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).isOut">{{JSON.parse(editForm3.afterContent).isOut?'是':'否'}}</div></td>
        </tr>
        <tr>
          <th>调出时间</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).outDate">{{JSON.parse(editForm3.beforeContent).outDate}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).outDate">{{JSON.parse(editForm3.afterContent).outDate}}</div></td>
        </tr>
        <tr>
          <th>去向</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).transferDirection">{{JSON.parse(editForm3.beforeContent).transferDirection}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).transferDirection">{{JSON.parse(editForm3.afterContent).transferDirection}}</div></td>
        </tr>
        <tr>
          <th>备注：</th>
          <td colspan="3"><div v-if="editForm3.beforeContent&&JSON.parse(editForm3.beforeContent).remarks">{{JSON.parse(editForm3.beforeContent).remarks}}</div></td>
          <td colspan="2"><div v-if="editForm3.afterContent&&JSON.parse(editForm3.afterContent).remarks">{{JSON.parse(editForm3.afterContent).remarks}}</div></td>
        </tr>
      </table>
    </el-dialog>
    <el-radio-group v-model="status" >
      <!-- <el-radio-button :label="1">正高级专业技术岗位人员</el-radio-button> -->
      <el-radio-button :label="1">岗位人员</el-radio-button>
      <el-radio-button :label="3">调出库</el-radio-button>
      <el-radio-button :label="4">日志</el-radio-button>
    </el-radio-group> <span v-if="personTime">最后修改时间：{{personTime}}</span>
    <div v-show="status===1">
      <h1 style="text-align:center">岗位人员情况表</h1>
      <div v-if="canEdit">
        <!-- <el-button icon="el-icon-upload2" type="success" style="float:right">批量导入</el-button>
        <el-button icon="el-icon-download" type="primary" style="float:right;margin-right:10px">下载模板</el-button> -->
        <!-- <el-button icon="el-icon-plus" @click="addFormVisible1=true" type="success" style="float:right;margin-left:10px">新增</el-button> -->
        <el-button icon="el-icon-plus" type="success" style="float:right" @click="handleAdd()">新增</el-button>
        <!-- <el-button icon="el-icon-document-copy" type="primary" style="float:right;">初始化</el-button> -->
      </div>
      <div v-else>
        <el-button icon="el-icon-download" type="primary" style="float:right">导出</el-button>
      </div>
      <el-form :inline="true" :model="filters" style="margin-top:20px">
        <div>
          <el-form-item label="单位名称">
            <el-input v-model="filters.unitName"></el-input>
          </el-form-item>
          <el-form-item label="姓名">
            <el-input v-model="filters.realName"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="searchList" icon="el-icon-search">查询</el-button>
          </el-form-item>
        </div>
      </el-form>
      <el-table :data="list" highlight-current-row v-loading="listLoading" style="width: 100%;margin-bottom: 20px;">
        <el-table-column prop="unitName" label="单位" min-width="100">
        </el-table-column>
        <el-table-column prop="deparentment" width="120" label="部门" />
        <el-table-column prop="postClass" width="150" label="岗位类别" align="center" >
          <template slot-scope="scope">
            {{postClassList[scope.row.postClass-1]}}
          </template>
        </el-table-column>
        <el-table-column prop="postLevel" width="100" label="岗位等级" align="center" >
          <template slot-scope="scope">
            <span v-if="scope.row.postClass===1">{{managePostLevel.find(item=>item.id===scope.row.postLevel).label}}</span>
            <span v-else-if="scope.row.postClass===2">{{techPostLevel.find(item=>item.id===scope.row.postLevel).label}}</span>
            <span v-else-if="scope.row.postClass===3">{{workPostLevel.find(item=>item.id===scope.row.postLevel).label}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="realName" width="80" label="姓名" align="center" >
        </el-table-column>
        <el-table-column prop="idCardNo" width="200" label="身份证号" align="center" >
        </el-table-column>
        <el-table-column prop="gender" width="50" label="性别" align="center">
          <template slot-scope="scope">
            {{scope.row.gender===2?'男':'女'}}
          </template>
        </el-table-column>
        <el-table-column prop="birthday" width="120" label="出生日期" align="center" >
        </el-table-column>
        <el-table-column prop="education" width="120" label="最高学历" align="center" >
        </el-table-column>
        <el-table-column prop="degree" width="80" label="最高学位" align="center" >
        </el-table-column>
        <el-table-column prop="jobTitle" width="80" label="职称" align="center" >
        </el-table-column>
        <el-table-column label="操作" width="120" v-if="canEdit" key="edit">
          <template slot-scope="scope">
            <template>
              <el-dropdown split-button  @click="handleDetail2(scope.row,1)" size="small" type="primary">
                调出
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item @click.native="handleDetail(scope.row,1)" >修改</el-dropdown-item>
                  <el-dropdown-item @click.native="handleDel(scope.row.id)" >删除</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
            </template>
          </template>
        </el-table-column>
        <el-table-column v-else key="editcol1" label="操作" width="120">
          <template slot-scope="scope">
            <template>
              <el-button @click.native="handleDetail(scope.row,0)" size="small" type="primary">查看</el-button>
            </template>
          </template>
        </el-table-column>
      </el-table>
      <div class="block">
        <el-pagination :total="totalnum" :page-size="pageSize" @current-change="handleCurrentChange" :current-page="pageNum" @size-change="handleSizeChange" :page-sizes="[10, 20, 30, 50]" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
      </div>
    </div>
    <div v-show="status===3">
      <h1 style="text-align:center">人员调出情况表</h1>
      <div v-if="canEdit">
        <!-- <el-button icon="el-icon-upload2" type="success" style="float:right">批量导入</el-button>
        <el-button icon="el-icon-download" type="primary" style="float:right;margin-right:10px">下载模板</el-button>
        <el-button icon="el-icon-document-copy" type="primary" style="float:right;">初始化</el-button> -->
      </div>
      <div v-else>
        <el-button icon="el-icon-download" type="primary" style="float:right">导出</el-button>
      </div>
      <el-form :inline="true" :model="filters2" style="margin-top:20px">
        <div>
          <el-form-item label="单位名称">
            <el-input v-model="filters2.unitName"></el-input>
          </el-form-item>
          <el-form-item label="姓名">
            <el-input v-model="filters2.realName"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="searchList2" icon="el-icon-search">查询</el-button>
          </el-form-item>
        </div>
      </el-form>
      <el-table :data="list2" highlight-current-row v-loading="listLoading2" style="width: 100%;margin-bottom: 20px;">
        <el-table-column width="150" label="岗位类别" align="center" >
          <template slot-scope="scope">
            {{postClassList[scope.row.postClass-1]}}
          </template>
        </el-table-column>
        <el-table-column width="100" label="岗位等级" align="center" >
          <template slot-scope="scope">
            <span v-if="scope.row.postClass===1">{{managePostLevel.find(item=>item.id===scope.row.postLevel).label}}</span>
            <span v-else-if="scope.row.postClass===2">{{techPostLevel.find(item=>item.id===scope.row.postLevel).label}}</span>
            <span v-else-if="scope.row.postClass===3">{{workPostLevel.find(item=>item.id===scope.row.postLevel).label}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="unitName" label="单位" min-width="100">
        </el-table-column>
        <el-table-column prop="deparentment" width="120" label="部门" />
        <el-table-column prop="realName" width="80" label="姓名" align="center" >
        </el-table-column>
        <el-table-column prop="outDate" width="120" label="调出时间" />
        <el-table-column prop="transferDirection" width="120" label="去向" />
        <el-table-column prop="remarks" width="120" label="备注" />
        <el-table-column label="操作" width="120" v-if="canEdit" key="edit">
          <template slot-scope="scope">
            <template>
              <el-dropdown split-button  @click="handleDetail2(scope.row,1)" size="small" type="primary">
                修改
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item @click.native="handleDel(scope.row.id)" >删除</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
            </template>
          </template>
        </el-table-column>
        <el-table-column v-else key="editcol2" label="操作" width="120">
          <template slot-scope="scope">
            <template>
              <el-button @click="handleDetail2(scope.row,0)" size="small" type="primary">查看</el-button>
            </template>
          </template>
        </el-table-column>
      </el-table>
      <div class="block">
        <el-pagination :total="totalnum2" :page-size="pageSize2" @current-change="handleCurrentChange2" :current-page="pageNum2" @size-change="handleSizeChange2" :page-sizes="[10, 20, 30, 50]" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
      </div>
    </div>
    <div v-show="status===4">
      <h1 style="text-align:center">修改日志</h1>
      <!-- <div>
        <el-button icon="el-icon-download" type="primary" style="float:right;margin-bottom:10px">导出</el-button>
      </div> -->
      <el-table :data="list3" highlight-current-row v-loading="listLoading3" style="width: 100%;margin-bottom: 20px;">
        <el-table-column prop="postClass" width="150" label="岗位类别" align="center" >
          <template slot-scope="scope">
            {{fpostClass(JSON.parse(scope.row.afterContent).postClass?JSON.parse(scope.row.afterContent).postClass:JSON.parse(scope.row.beforeContent).postClass)}}
          </template>
        </el-table-column>
        <el-table-column prop="postLevel" width="100" label="岗位等级" align="center" >
          <template slot-scope="scope">
            {{fpostLevel((JSON.parse(scope.row.afterContent).postLevel||JSON.parse(scope.row.afterContent).postLevel===0)?JSON.parse(scope.row.afterContent).postLevel:JSON.parse(scope.row.beforeContent).postLevel)}}
          </template>
        </el-table-column>
        <el-table-column prop="unit" label="单位" min-width="100" header-align="center">
          <template slot-scope="scope">
            {{JSON.parse(scope.row.afterContent).unitName?JSON.parse(scope.row.afterContent).unitName:JSON.parse(scope.row.beforeContent).unitName}}
          </template>
        </el-table-column>
        <el-table-column width="80" label="姓名" align="center" >
          <template slot-scope="scope">
            {{JSON.parse(scope.row.afterContent).realName?JSON.parse(scope.row.afterContent).realName:JSON.parse(scope.row.beforeContent).realName}}
          </template>
        </el-table-column>
        <el-table-column prop="operateTime" width="200" label="操作时间" align="center" />
        <el-table-column prop="operateUser" width="120" label="操作用户" align="center" />
        <el-table-column prop="operateType" width="320" label="日志类型" align="center">
          <template slot-scope="scope">
            <span v-if="scope.row.operateType===1">新增</span>
            <span v-else-if="scope.row.operateType===2">修改</span>
            <span v-else-if="scope.row.operateType===3">删除</span>
          </template>
        </el-table-column>
        <el-table-column key="editcol3" label="操作" width="120" align="center">
          <template slot-scope="scope">
            <template>
              <el-button @click="handleDetail3(scope.row)" size="small" type="primary">查看</el-button>
            </template>
          </template>
        </el-table-column>
      </el-table>
      <div class="block">
        <el-pagination :total="totalnum3" :page-size="pageSize3" @current-change="handleCurrentChange3" :current-page="pageNum3" @size-change="handleSizeChange3" :page-sizes="[10, 20, 30, 50]" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
      </div>
    </div>
    <!-- <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div> -->
  </div>
</template>
<script>
const defaultForm = {
  id: null,
  unitName: '',
  postClass: null,
  postLevel: null,
  deparentment: '',
  realName: '',
  gender: null,
  education: '',
  degree: '',
  degreeClass: '',
  birthday: '',
  job: '',
  jobTitle: '',
  idCardNo: '',
  school: '',
  researchDirection: '',
  talentProjects: '',
  docDate: [],
  startDate: '',
  endDate: '',
  useTechPost2: null,
  postType: null,
  postId: null,
  outDate: null,
  transferDirection: '',
  isOut: null,
  remarks: ''
}
export default {
  props: {
    timestamp: '',
    canEdit: null,
    canAudit: null,
    unitId: null
  },
  watch: {
    timestamp: {
      handler (val) {
        this.loaddata()
      },
      immediate: true
    },
    unitId: {
      handler (val) {
        this.loaddata()
      },
      immediate: true
    },
    canEdit: {
      handler (val) {
        console.log(val)
      },
      immediate: true
    }
  },
  data () {
    return {
      personTime: '',
      editForm3: {},
      saveloading: false,
      editFormVisible: false,
      editFormVisible2: false,
      editFormVisible3: false,
      dialogTitle: '新增',
      editFlag: 0,
      listLoading: false,
      listLoading2: false,
      listLoading3: false,
      docList: [],
      selectLoading: false,
      pageNum: 1,
      pageSize: 20,
      totalnum: 0,
      pageNum2: 1,
      pageSize2: 20,
      totalnum2: 0,
      pageNum3: 1,
      pageSize3: 20,
      totalnum3: 0,
      educationList: ['研究生', '大学本科', '大学专科', '中专', '高中及以下'],
      degreeList: ['学士', '硕士', '博士'],
      jobTitleList: ['正高', '副高', '中级', '初级', '空'],
      postTypeList: ['基础性指标', '科技人才奖励指标', '部统筹指标'],
      filters: {unitName: '', realName: ''},
      filters2: {unitName: '', realName: ''},
      postClassList: ['管理岗位', '专业技术岗位', '工勤技能岗位'],
      postLevelList: [],
      editForm: Object.assign({}, defaultForm),
      editForm2: Object.assign({}, defaultForm),
      editFormRules: {
        unitName: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        postClass: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        postLevel: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        deparentment: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        realName: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        gender: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        education: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        degree: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        degreeClass: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        birthday: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        job: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        jobTitle: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        idCardNo: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        school: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        researchDirection: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        talentProjects: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        docDate: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        useTechPost2: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        postType: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        postId: [
          { required: true, message: '必填', trigger: 'blur' }
        ]
      },
      editFormRules2: {
        outDate: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        transferDirection: [
          { required: true, message: '必填', trigger: 'blur' }
        ],
        isOut: [
          { required: true, message: '必填', trigger: 'blur' }
        ]
      },
      status: 1,
      list: [],
      list2: [],
      list3: [],
      techPostLevel: [
        {id: 1, label: '一级'},
        {id: 2, label: '二级'},
        {id: 3, label: '三级'},
        {id: 4, label: '四级'},
        {id: 5, label: '五级'},
        {id: 6, label: '六级'},
        {id: 7, label: '七级'},
        {id: 8, label: '八级'},
        {id: 9, label: '九级'},
        {id: 10, label: '十级'},
        {id: 11, label: '十一级'},
        {id: 12, label: '十二级'},
        {id: 13, label: '十三级'}
      ],
      managePostLevel: [
        {id: 3, label: '三级'},
        {id: 4, label: '四级'},
        {id: 5, label: '五级'},
        {id: 6, label: '六级'},
        {id: 7, label: '七级'},
        {id: 8, label: '八级'},
        {id: 9, label: '九级'},
        {id: 10, label: '十级'}
      ],
      workPostLevel: [
        {id: 1, label: '一级'},
        {id: 2, label: '二级'},
        {id: 3, label: '三级'},
        {id: 4, label: '四级'},
        {id: 5, label: '五级'},
        {id: 0, label: '普通工'}
      ]
    }
  },
  methods: {
    getPersonTime () {
      if (this.unitId) {
        this.$http
          .get(this.$http.defaults.postAPI + `api/cadrePostBusUnit/getById?id=` + this.unitId)
          .then(response => {
            if (response.data.success === true) {
              this.personTime = response.data.result.updatePersonTime
            } else {
              console.log('获取失败:' + response.data.message)
              this.$message({
                message: '获取失败:' + response.data.message,
                type: 'error'
              })
            }
          })
          .catch(error => {
            console.log(error)
            this.$message({
              message: '获取失败:' + error,
              type: 'error'
            })
          })
      }
    },
    updatePersonTime () {
      if (this.unitId) {
        this.$http
          .get(this.$http.defaults.postAPI + `api/cadrePostBusUnit/updatePersonTime?unitId=` + this.unitId)
          .then(response => {
            if (response.data.success === true) {
              console.log('更新成功')
              this.personTime = response.data.result
            } else {
              console.log('更新失败:' + response.data.message)
              this.$message({
                message: '更新失败:' + response.data.message,
                type: 'error'
              })
            }
          })
          .catch(error => {
            console.log(error)
            this.$message({
              message: '更新失败:' + error,
              type: 'error'
            })
          })
      }
    },
    fpostClass (val) {
      return this.postClassList[val - 1]
    },
    fpostLevel (val) {
      return val === 0 ? '普通工' : this.techPostLevel[val - 1].label
    },
    loaddata () {
      this.getList()
      this.getList2()
      this.getList3()
      this.getPersonTime()
    },
    getList () {
      if (this.unitId) {
        let tableName = 'cadrePostBusPostPerson'
        this.listLoading = true
        let para = {
          pageNum: this.pageNum,
          pageSize: this.pageSize,
          unitId: this.unitId,
          unitName: this.filters.unitName,
          realName: this.filters.realName,
          isOut: 0
        }
        let url = this.$http.defaults.postAPI + 'api/' + tableName + '/queryByPage'
        this.$http.post(url, para).then(response => {
          this.listLoading = false
          if (response.data.success === true) {
            this.list = response.data.result.records
            this.totalnum = response.data.result.total
          } else {
            console.log('获取数据失败:' + response.data.message)
            this.$message({
              message: '获取数据失败:' + response.data.message,
              type: 'error'
            })
          }
        }).catch(error => {
          console.log(error)
          this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
          this.listLoading = false
        })
      }
    },
    getList2 () {
      if (this.unitId) {
        let tableName = 'cadrePostBusPostPerson'
        this.listLoading2 = true
        let para = {
          pageNum: this.pageNum2,
          pageSize: this.pageSize2,
          unitId: this.unitId,
          unitName: this.filters2.unitName,
          realName: this.filters2.realName,
          isOut: 1
        }
        let url = this.$http.defaults.postAPI + 'api/' + tableName + '/queryByPage'
        this.$http.post(url, para).then(response => {
          this.listLoading2 = false
          if (response.data.success === true) {
            this.list2 = response.data.result.records
            this.totalnum2 = response.data.result.total
          } else {
            console.log('获取数据失败:' + response.data.message)
            this.$message({
              message: '获取数据失败:' + response.data.message,
              type: 'error'
            })
          }
        }).catch(error => {
          console.log(error)
          this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
          this.listLoading2 = false
        })
      }
    },
    getList3 () {
      if (this.unitId) {
        let tableName = 'cadrePostBusLog'
        this.listLoading3 = true
        let para = {
          pageNum: this.pageNum3,
          pageSize: this.pageSize3,
          unitId: this.unitId,
          businessTable: 'bus_post_person'
        }
        let url = this.$http.defaults.postAPI + 'api/' + tableName + '/queryByPage'
        this.$http.post(url, para).then(response => {
          this.listLoading3 = false
          if (response.data.success === true) {
            this.list3 = response.data.result.records
            this.list3.forEach((item, index) => {
              if (!item.afterContent) { this.list3[index].afterContent = '{}' }
              if (!item.beforeContent) { this.list3[index].beforeContent = '{}' }
            })
            this.totalnum3 = response.data.result.total
          } else {
            console.log('获取数据失败:' + response.data.message)
            this.$message({
              message: '获取数据失败:' + response.data.message,
              type: 'error'
            })
          }
        }).catch(error => {
          console.log(error)
          this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
          this.listLoading3 = false
        })
      }
    },
    editFormSubmit () {
      this.$refs.editForm.validate((valid) => {
        if (valid) {
          this.saveloading = true
          let para = Object.assign({}, this.editForm)
          para.unitId = this.unitId
          if (para.docDate.length > 0) {
            para.startDate = para.docDate[0]
            para.endDate = para.docDate[1]
            para.docDate = null
          }
          para.isOut = 0
          let tableName = 'cadrePostBusPostPerson'
          this.$http.post(this.$http.defaults.postAPI + 'api/' + tableName + '/save', para).then(response => {
            console.log(response.data.success)
            this.saveloading = false
            if (response.data.success === true) {
              this.$message({
                message: '提交成功',
                type: 'success'
              })
              this.editFormVisible = false
              this.updatePersonTime()
              this.getList()
            } else {
              console.log('提交失败:' + response.data.message)
              this.$message({
                message: '提交失败:' + response.data.message,
                type: 'error'
              })
            }
          }).catch(error => {
            console.log(error)
            this.$message({
              message: '提交失败:' + error,
              type: 'error'
            })
            this.saveloading = false
          })
        }
      })
    },
    editFormSubmit2 () {
      this.$refs.editForm2.validate((valid) => {
        if (valid) {
          this.saveloading = true
          let para = {
            id: this.editForm2.id,
            isOut: this.editForm2.isOut,
            outDate: this.editForm2.outDate,
            transferDirection: this.editForm2.transferDirection,
            remarks: this.editForm2.remarks
          }
          let tableName = 'cadrePostBusPostPerson'
          this.$http.post(this.$http.defaults.postAPI + 'api/' + tableName + '/save', para).then(response => {
            console.log(response.data.success)
            this.saveloading = false
            if (response.data.success === true) {
              this.$message({
                message: '提交成功',
                type: 'success'
              })
              this.editFormVisible2 = false
              this.getList()
              this.getList2()
              this.updatePersonTime()
            } else {
              console.log('提交失败:' + response.data.message)
              this.$message({
                message: '提交失败:' + response.data.message,
                type: 'error'
              })
            }
          }).catch(error => {
            console.log(error)
            this.$message({
              message: '提交失败:' + error,
              type: 'error'
            })
            this.saveloading = false
          })
        }
      })
    },
    handleAdd () {
      this.dialogTitle = '新增'
      this.editForm = Object.assign({}, defaultForm)
      this.editFormVisible = true
      this.editFlag = 1
    },
    handleDetail (obj, editFlag) {
      this.dialogTitle = editFlag ? '修改' : '详情'
      this.editForm = Object.assign({}, defaultForm)
      if (editFlag) {
        this.$nextTick(() => {
          this.changePostType(1, obj)
        })
      } else {
        this.editForm = Object.assign({}, obj)
        this.changePostClass()
        this.editForm = Object.assign({}, obj)
        this.editForm.docDate = [this.editForm.startDate, this.editForm.endDate]
      }
      this.editFormVisible = true
      this.editFlag = editFlag
    },
    handleDetail2 (obj, editFlag) {
      this.dialogTitle = editFlag ? '修改' : '详情'
      this.editForm2 = Object.assign({}, obj)
      this.editFormVisible2 = true
      this.editFlag = editFlag
    },
    handleDetail3 (obj, editFlag) {
      this.dialogTitle = editFlag ? '修改' : '详情'
      this.editForm3 = Object.assign({}, obj)
      this.editFormVisible3 = true
    },
    handleDel (id) {
      this.$confirm('确认删除该记录吗?', '提示', {
        type: 'warning'
      }).then(() => {
        let tableName = 'cadrePostBusPostPerson'
        let para = {ids: [id]}
        this.$http.post(this.$http.defaults.postAPI + 'api/' + tableName + '/remove', para).then(response => {
          if (response.data.success === true) {
            this.$message({
              message: '删除成功',
              type: 'success'
            })
            this.updatePersonTime()
          } else {
            console.log('删除失败:' + response.data.message)
            this.$message({
              message: '删除失败:' + response.data.message,
              type: 'error'
            })
          }
          this.getList()
          this.getList2()
        })
          .catch(error => {
            console.log(error)
            this.$message({
              message: '删除失败:' + error,
              type: 'error'
            })
          })
      })
    },
    changePostType (flag, obj) {
      console.log(obj)
      this.docList = []
      this.editForm.postId = null
      this.selectLoading = true
      if (flag) {
        this.editForm = Object.assign({}, obj)
        this.changePostClass()
        this.editForm = Object.assign({}, obj)
        this.editForm.docDate = [this.editForm.startDate, this.editForm.endDate]
      }
      if (this.editForm.postType === 1) {
        let tableName = 'cadrePostBusPostPlan'
        let para = {
          pageNum: 1,
          pageSize: 1000,
          unitId: this.unitId,
          state: 1
        }
        this.$http.post(this.$http.defaults.postAPI + 'api/' + tableName + '/queryByPage', para).then(response => {
          this.selectLoading = false
          if (response.data.success === true) {
            this.docList = response.data.result.records
            if (flag) {
              this.editForm = Object.assign({}, obj)
              this.changePostClass()
              this.editForm = Object.assign({}, obj)
              this.editForm.docDate = [this.editForm.startDate, this.editForm.endDate]
            }
          } else {
            console.log('获取数据失败:' + response.data.message)
            this.$message({
              message: '获取数据失败:' + response.data.message,
              type: 'error'
            })
          }
        }).catch(error => {
          this.selectLoading = false
          console.log(error)
          this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
        })
      } else if (this.editForm.postType === 2) {
        let tableName = 'cadrePostBusTalentsPost'
        let para = {
          unitId: this.unitId,
          state: 1
        }
        this.$http.post(this.$http.defaults.postAPI + 'api/' + tableName + '/queryList', para).then(response => {
          this.selectLoading = false
          if (response.data.success === true) {
            this.docList = response.data.result
            if (flag) {
              this.editForm = Object.assign({}, obj)
              this.changePostClass()
              this.editForm = Object.assign({}, obj)
              this.editForm.docDate = [this.editForm.startDate, this.editForm.endDate]
            }
          } else {
            console.log('获取数据失败:' + response.data.message)
            this.$message({
              message: '获取数据失败:' + response.data.message,
              type: 'error'
            })
          }
        }).catch(error => {
          this.selectLoading = false
          console.log(error)
          this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
        })
      } else if (this.editForm.postType === 3) {
        let tableName = 'cadrePostBusAchievementsPost'
        let para = {
          unitId: this.unitId,
          state: 1
        }
        this.$http.post(this.$http.defaults.postAPI + 'api/' + tableName + '/queryList', para).then(response => {
          this.selectLoading = false
          if (response.data.success === true) {
            this.docList = response.data.result.list
            if (flag) {
              this.editForm = Object.assign({}, obj)
              this.changePostClass()
              this.editForm = Object.assign({}, obj)
              this.editForm.docDate = [this.editForm.startDate, this.editForm.endDate]
            }
          } else {
            console.log('获取数据失败:' + response.data.message)
            this.$message({
              message: '获取数据失败:' + response.data.message,
              type: 'error'
            })
          }
        }).catch(error => {
          this.selectLoading = false
          console.log(error)
          this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
        })
      }
    },
    searchList () {
      this.pageNum = 1
      this.getList()
    },
    searchList2 () {
      this.pageNum2 = 1
      this.getList2()
    },
    handleSizeChange (val) {
      this.pageNum = 1
      this.pageSize = val
      this.getList()
    },
    handleSizeChange2 (val) {
      this.pageNum2 = 1
      this.pageSize2 = val
      this.getList2()
    },
    handleSizeChange3 (val) {
      this.pageNum3 = 1
      this.pageSize3 = val
      this.getList3()
    },
    handleCurrentChange (val) {
      this.pageNum = val
      this.getList()
    },
    handleCurrentChange2 (val) {
      this.pageNum2 = val
      this.getList2()
    },
    handleCurrentChange3 (val) {
      this.pageNum3 = val
      this.getList3()
    },
    changePostClass () {
      this.editForm.postLevel = null
      switch (this.editForm.postClass) {
        case 1:
          this.postLevelList = this.managePostLevel
          break
        case 2:
          this.postLevelList = this.techPostLevel
          break
        case 3:
          this.postLevelList = this.workPostLevel
          break
      }
    }
  }
}
</script>
<style scoped>
  .mytable{
    border-top: 1px solid #74a6cc;
    border-left: 1px solid #74a6cc;
    margin:0 10px 10px;
    width: calc(100% - 20px);
  }
  .mytable th{
    padding: 10px;
    border-right: 1px solid #74a6cc;
    border-bottom: 1px solid #74a6cc;
    vertical-align: top;
    line-height: 150%;
    background: #FAFAFA;
    width:200px;
    text-align:right;
  }
  .mytable td{
    padding: 10px;
    border-right: 1px solid #74a6cc;
    border-bottom: 1px solid #74a6cc;
    vertical-align: top;
    line-height: 150%;
  }
</style>
<style>
#recruitTable .el-table{
  border:1px solid #95B8E7 !important;
}
#recruitTable .el-table td, #recruitTable .el-table th{
  border-right:1px solid #95B8E7 !important;
  border-bottom:1px solid #95B8E7 !important;
}
</style>
